// app.js
import './utils/utils'
import './utils/http'
App({
  token: '',
  refreshToken: '',
  // 存token
  setToken (token, refreshToken) {
    wx.setStorageSync('token', token)
    this.token = token

    wx.setStorageSync('refreshToken', refreshToken)
    this.refreshToken = refreshToken
  },
  // 取token
  getToken () {
    const token = wx.getStorageSync('token')
    this.token = token

    const refreshToken = wx.getStorageSync('refreshToken')
    this.refreshToken = refreshToken
  },
  // 进入小程序就取一下token
  onLaunch () {
    this.getToken()
  }
})
